package com.etcn.modules.statical.base.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.etcn.common.service.impl.CrudServiceImpl;
import com.etcn.modules.statical.base.dao.IBaseCompanyDao;
import com.etcn.modules.statical.base.pojo.BaseCompany;
import com.etcn.modules.statical.base.service.IBaseCompanyService;

/**
 * 企业serviceImpl
 * 
 * @author guozc
 * @date 2018-01-12 10:49:26
 */
@Service("baseCompanyService")
public class BaseCompanyServiceImpl extends CrudServiceImpl<IBaseCompanyDao, BaseCompany>
		implements IBaseCompanyService {

	@Override
	public List<BaseCompany> findList(BaseCompany entity) throws Exception {
		List<BaseCompany> companys = super.findList(entity);
		if (companys != null) {
			for (BaseCompany company : companys) {
				if(company.getImportExponent() == null){
					company.setImportExponent("");
				}
				if(company.getExportExponent() == null){
					company.setExportExponent("");
				}
			}
		}
		return companys;
	}

	@Override
	public BaseCompany getByCode(String code) throws Exception {
		return dao.getByCode(code);
	}

}